<template>
  <div class="content">
    <div class="card">
        <div class="shopType">{{ dataList[0] }}</div>
        <div class="right" v-if="dataList[1]">
            <div class="item" 
            v-for="(item,index) in dataList[1]" 
            :key="index" 
            @click="selectTap(item,index)"
            :class="isSeleted == index ? 'isSeleted' : ''"
            >{{ item }}</div>
        </div>
    </div>
  </div>
</template>

<script>
export default {
    props:{
        dataList:Array
    },
    data(){
        return{
            isSeleted:0
        }
    },
    methods:{
        selectTap(item,index){
            this.isSeleted = index
            this.$bus.$emit('pop',{type:this.dataList[0],item})
        }
    },
}
</script>

<style scoped>
.card{
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-top: 20px;
}
.right{
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.item {
    padding: 0px 10px 0px 10px;
}
.shopType{
    font-size: 22px;
}
.isSeleted{
    color: #ff6700;
    text-decoration: underline;
}
</style>